package com.read.mapper;

import com.read.dto.result.NovelSectionResultDto;
import com.read.entity.NovelSection;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NovelSectionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(NovelSection record);

    int insertSelective(NovelSection record);

    NovelSection selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(NovelSection record);

    int updateByPrimaryKey(NovelSection record);

    /**
     * @description 根据小说id获取章节目录
     * @author sh-sunb6
     * @date 2019-02-20 16:52
     * @params novelId
     */
    List<NovelSectionResultDto> selectNovelSectionByNovelId(Integer novelId);

    /**
     * @description 查询前一章、本章、下一章信息
     * @author sh-sunb6
     * @date 2019-03-15 13:54
     */
    List<NovelSectionResultDto> selectFrontCurrentBackSectionInfo(@Param("novelId") Integer novelId,@Param("start") Integer start,@Param("end") Integer end);

    /**
     * @description 获取第一章sectionId
     * @author sh-sunb6
     * @date 2019-03-18 15:32
     */
    public int selectFirstSectionIdByNovelId(@Param("novelId") int novelId);
}